<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>四川新华扬科技有限公司－小程序授权</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="../../AceAdmin/assets/css/bootstrap.min.css" rel="stylesheet" />
<link rel="stylesheet" href="../../AceAdmin/assets/css/font-awesome.min.css" />
<link rel="stylesheet" href="../../AceAdmin/assets/css/ui.jqgrid.css" />
<link rel="stylesheet" href="../../AceAdmin/assets/css/chosen.css" />
<link rel="stylesheet" href="../../AceAdmin/assets/css/ace.min.css" />
<script src="../../AceAdmin/assets/js/ace-extra.min.js"></script>


<script src="../../js/common.js" type="application/javascript"></script>
<style type="text/css">
      .routinetop{
        width: 100%;
        height: 80px;
        border-bottom: 1px solid #ccc;
      }
      .routinetopz{
        /*display: flex;*/
        width: 100%;
        height: 100%;
        margin: auto;
        text-align: center;
        line-height: 80px;
        font-size: 18px;
      }
      .routinetopz text{
        padding: 0 5px;
      }
      .routinetop1{
        color: #1AAD19;
      }
      .color{
        color: #111111;
      }
      .routineBottom{
        width: 100%;
        display: inline-block;
      }
      .routineBottomCom{
        width: 60%;
        margin:auto;
        display: flex;
        margin-top: 50px;
      }
      .routineBottomCom img{
        width: 80px;
        height: 80px;
      }
      .routineBottomCom text{
        width: calc(100% - 80px);
        /*line-height: 40px;*/
        display: block;
        font-size: 17px;
      }
      span{
        color: red;
      }
      .routineBottomComB{
        width: 45%;
        margin: auto;
        padding-top: 30px;
      }
      .routineBottomComB3{
        width: 45%;
        margin: auto;
        padding-top: 50px;
      }
      .routineBottomComB .p1{
        font-size: 14px;
      }
      .routineBottomComB .p2{
        font-size: 12px;
      }
      .buttonDiv{
        width: 100%;
        margin-top: 60px;
      }
      .button{
        width: 150px;
        line-height: 40px;
        background: #1AAD19;
        color: #fff;
        text-align: center;
        border-radius: 5px;
        margin: auto;
        cursor:pointer;
      }
      .routineBottom2{
        width: 100%;
        display: none;
      }
      .communication{
        line-height: 80px;
      }
      .last1{
        width: 150px;
        line-height: 40px;
        color: #808080;
        text-align: center;
        margin: auto;
        cursor: pointer;
      }

      .buttonDiv3{
        margin-top: 120px;
        width: 100%;
      }
</style>
</head>
<body>
<div class="routine">

<div class="routinetop">
    <div class="routinetopz">
        <text class="routinetop1">1.注册小程序</text>
        <text class="routinetop2 color">--------</text>
        <text class="routinetop3 color">2.小程序授权</text>
    </div>
</div>
<div class="routineBottom">
    <div class="routineBottomCom"><img src="../../imgs/index/routine.png"><text><div style="height: 20px;"></div>AI雷达需要强大的小程序提供支持，因此你需要为你的企业申请<span>注册一个全新的微信小程序</span></text></div>
    <div class="routineBottomComB">
        <p class="p1">请根据你的企业情况进行选择：</p>
        <p class="p1"><a href="https://mp.weixin.qq.com/cgi-bin/wx" target="_blank">点击此处</a>申请微信小程序，审核需要1~3个工作日</p>
        <p class="p2">1.只能使用企业营业执照为主体注册的小程序，一个公司主体可以注册多个小程序</p>
        <p class="p2">2.小程序注册名建议使用“公司名简称+名片”或“公司名简称+官网”</p>
        <p class="p2">更多小程序注册注意事项，请查阅<a>小程序注册指引</a></p>
    </div>
    <div class="buttonDiv">
        <div class="button lext1">我已经注册好了，下一步</div>
    </div>
    
</div>
<div class="routineBottom2">
    <div class="routineBottomCom"><img src="../../imgs/index/routine.png"><text><div style="height: 20px;"></div>只需要将你注册好的小程序授权到AI名片系统即可，确保授权的小程序和企业微信两者的注册主体保持一致</text></div>
    <div class="routineBottomComB3">
        <p class="p1">更多注意事项可参考<a href="">小程序授权指引</a></p>
    </div>
    <div class="buttonDiv3">
        <div class="button lext2">立即授权</div>
        <div class="last1">返回上一步</div>
    </div>
    
</div>

</div>
</body>
<script type="text/javascript">
        window.jQuery || document.write("<script src='../../AceAdmin/assets/js/jquery-2.0.3.min.js'>"+"<"+"/script>");
    </script>
    <script type="text/javascript">
        if("ontouchend" in document) document.write("<script src='assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
    </script>
<script src="../../AceAdmin/assets/js/jquery.dataTables.min.js"></script>
<script src="../../AceAdmin/assets/js/jquery.dataTables.bootstrap.js"></script>
<script src="../../AceAdmin/assets/js/bootstrap.min.js"></script>
<script src="../../AceAdmin/assets/js/typeahead-bs2.min.js"></script>
<script src="../../AceAdmin/assets/js/chosen.jquery.min.js"></script>
<script src="../../AceAdmin/assets/js/ace-elements.min.js"></script>
<script src="../../AceAdmin/assets/js/ace.min.js"></script>
<script src="../../AceAdmin/assets/js/bootbox.min.js"></script>
<script type="text/javascript">
	$(".lext1").click(function(){
		console.log(1111111111111)
        $(".routinetop2").css("color","#1AAD19")
        $(".routinetop3").css("color","#1AAD19")
        $(".routineBottom").css("display","none")
        $(".routineBottom2").css("display","block")
        $.ajax({
            url:"https://minitest.17jxyx.com/api/v1/mini/get_auth_url",
            type:"GET",
            beforeSend: function (request) {
                request.setRequestHeader('token', window.base.getLocalStorage('token'));
            },
            success:function(res){
            	console.log(res)
                // $(".companytop2").css("color","#1AAD19")
                // $(".companytop3").css("color","#1AAD19")
                // $(".companyBottom").css("display","none")
                // $(".companyBottom2").css("display","block")
                $(".lext2").click(function(){
                	window.open(res)	
                    bootbox.dialog({
                        message: "<div class='row'><div class='accredit'>提示</div><div class='accreditBott'>是否授权成功</div></div>",
                        buttons:{
                            "还未授权":{
                                "className": "btn-sm no btn-success",
                                "callback":function(){ 
                                }
                            },
                            "我已授权成功":{
                                "className": "btn-sm yes btn-success",
                                "display":"none",
                                "callback":function(){ 
                                  $.ajax({
                                    url:"https://minitest.17jxyx.com/api/v1/thirdapp/auth_info",
                                    type:"GET",
                                    beforeSend: function (request) {
                                        request.setRequestHeader('token', window.base.getLocalStorage('token'));
                                    },
                                    success:function(res){
                                        if(res.mini == 1){
                                            window.location.href = 'https://business.17jxyx.com/pages/index.html';
                                        }else{
                                           alert("对不起，请重新授权")
                                        }
                                    },
                                    error:function(res){
                                      okenDetection(res)
                                    }
                                  });
                                }
                            }
                         }
                    })
                    $(".modal-content").css("margin-top","20%")
                    window.open(res)

                })
                // console.log(res)
            },
            error:function(res){
              okenDetection(res)
            }
        });

    })
    $(".last1").click(function(){
        $(".routinetop2").css("color","#111111")
        $(".routinetop3").css("color","#111111")
        $(".routineBottom2").css("display","none")
        $(".routineBottom").css("display","block")
    })
</script>
</html>